﻿using AspNet.Identity.Dapper;
using AspNet.Identity.Dapper.Db;
using Microsoft.AspNet.Identity;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using System.Web;

namespace AspNet.Identity.WebApp.Models
{
    public class AppUser : IdentityUser
    {
        public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<AppUser,Guid> manager)
        {
            var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
            return userIdentity;
        }
    }

    public class IdentityDbContext : DbManager
    {
        public IdentityDbContext(string connectionName):base(connectionName)
        {
            
        }

        public static IdentityDbContext Create()
        {
            return new IdentityDbContext(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString);
        }


    }
}